<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>FIRST LEGO League na Slovensku - FLL na Slovensku</title>
<base href="http://www.fll.sk/" />
<link href="http://kempelen.ii.fmph.uniba.sk/letnaliga/styles.css" rel="stylesheet" type="text/css" />
</head>
    <body>
        <h2>Editor riešenia</h2>
        <?php echo form_open_multipart('upload_control/do_upload');?>
            <table>
                <tr>
                    <td><label for="file">Vyberte fotku</label></td>
                    <td><input id="file" type="file" name="userfile" size="20" /></td>
                    <td><?php echo form_submit('zadanie', 'Nahraj fotku'); ?></td>
                </tr>
            </table>
        </form>
        <?php if (isset($error)){ ?> 
            <p><?php echo $error; ?></p>
        <?php } ?>
        <p>
            <?php if(!empty($obrazky[0]->link)) { 
                echo "Doposiaľ nahrané obrázky:<br/>";
                foreach($obrazky as $img) { ?>
                <p>
                    <?php list($width, $height) = getimagesize("http://kempelen.ii.fmph.uniba.sk/letnaliga/images/".$img->link);
                        if($width > 528) {
                    ?>
                    <a target="_blank" href="http://kempelen.ii.fmph.uniba.sk/letnaliga/images/<?php echo $img->link; ?>"><image src = "http://kempelen.ii.fmph.uniba.sk/letnaliga/images/<?php echo $img->link; ?>" alt = "solution" style="width: 100%;"/></a>
                    </br><a href="<?php echo site_url('upload_control/delete_image/'.$img->link); ?>">Vymazať</a>
                    <?php ;} else { ?>
                    <a target="_blank" href="http://kempelen.ii.fmph.uniba.sk/letnaliga/images/<?php echo $img->link; ?>"><image src = "http://kempelen.ii.fmph.uniba.sk/letnaliga/images/<?php echo $img->link; ?>" alt = "solution"/></a>
                    </br><a href="<?php echo site_url('upload_control/delete_image/'.$img->link); ?>">Vymazať</a>
                    <?php ;} ?>
                </p>
            <?php }
            } ?>
        </p>
        <?php echo form_open('upload_control/upload_url'); ?>
                <label for='link'>Youtube link:</label>
                <input type='text' id='link' name='link'></input>
            <?php echo form_submit('videjo', 'Pridaj video'); ?>
        </form>
        <?php
            echo 'Doterajšie pridané videá:<br/>';
            if(!empty($links[0]->link)) {
                foreach($links as $link){
            ?>
                <iframe height="350" src="<?php echo $link->link; ?>" frameborder="0" allowfullscreen style="width: 100%;"></iframe><br/><a href="<?php echo site_url('upload_control/delete_url/'.$link->id); ?>">Vymazať</a>
            <?php
            }}
            ?>
        <p>
        <a href="<?php echo site_url('projekt/show_mission/'.$mid); ?>"> Uložiť </a>
        </p>
    </body>

</html>
